package com.errol.batchprocessor.employeeaddition;

import com.renjia.entity.CoreEmployeeImportBatch;
import com.renjia.service.generic.log.LogService;
import com.renjia.service.generic.middleware.batchprocessor.AbstractBatchProcessorImpl;
import com.renjia.service.module.employeeaddition.advisor.*;
import com.renjia.service.module.employeeaddition.advisorimpl.EmployeeAdvisorTypeEnum;
import com.renjia.service.module.employeeaddition.advisorimpl.common.payload.AbstractEmployeeBatchPayload;
import com.renjia.service.module.employeeaddition.advisorimpl.common.payload.AbstractEmployeePiecePayload;
import com.renjia.service.module.employeeaddition.advisorimpl.common.payload.AbstractEmployeeSinglePayload;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.stereotype.Service;

/**
 * 人员导入批处理实现，继承自批处理模型抽象实现
 *
 * @author zhang xiao bin
 * @version v1.0
 * @date 2021/02/23
 * @since v5.0.5
 **/
@Service
public class EmployeeAdditionServiceImpl<BE, SE, BP extends AbstractEmployeeBatchPayload<BE, SE>, PP extends AbstractEmployeePiecePayload<SE, SP>, SP extends AbstractEmployeeSinglePayload<SE>>
        extends AbstractBatchProcessorImpl<CoreEmployeeImportBatch, EmployeeAdvisorTypeEnum, BE, SE, BP, PP, SP>
        implements DisposableBean, EmployeeAdditionService<BE, SE, BP, PP, SP> {

    public EmployeeAdditionServiceImpl(EmployeeBatchAddAdvisor<BE, SE, BP, PP, SP> batchAddAdvisor,
                                       EmployeeBatchStartAdvisor<BE, SE, BP, PP, SP> batchStartAdvisor,
                                       EmployeeBatchFinishAdvisor<BE, SE, BP, PP, SP> batchFinishAdvisor,
                                       EmployeeBatchPostAdvisor<BE, SE, BP, PP, SP> batchPostAdvisor,
                                       EmployeePieceStartAdvisor<BE, SE, BP, PP, SP> pieceStartAdvisor,
                                       EmployeePieceFinishAdvisor<BE, SE, BP, PP, SP> pieceFinishAdvisor,
                                       EmployeePiecePostAdvisor<BE, SE, BP, PP, SP> piecePostAdvisor,
                                       EmployeeSingleStartAdvisor<BE, SE, BP, PP, SP> singleStartAdvisor,
                                       EmployeeSingleProcessAdvisor<BE, SE, BP, PP, SP> singleProcessAdvisor,
                                       EmployeeSingleFinishAdvisor<BE, SE, BP, PP, SP> singleFinishAdvisor,
                                       EmployeeSinglePostAdvisor<BE, SE, BP, PP, SP> singlePostAdvisor,
                                       LogService logService) {
        super(batchAddAdvisor, batchStartAdvisor, batchFinishAdvisor, batchPostAdvisor, pieceStartAdvisor, pieceFinishAdvisor, piecePostAdvisor,
                singleStartAdvisor, singleProcessAdvisor, singleFinishAdvisor, singlePostAdvisor, logService);
    }

    @Override
    protected String logPrefix() {
        return "【人员导入批处理】";
    }
}
